package com.shanghaionstar.navi.search.result;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.amap.api.services.help.Tip;
import com.shanghaionstar.R;
import com.shanghaionstar.navi.base.BaseRecyclerAdapter;
import com.shanghaionstar.navi.search.viewholder.NavSearchResultVH;


/**
 * Created by zhaoyang on 2017/7/21.
 */

public class NavSearchResultAdapter extends BaseRecyclerAdapter<Tip, NavSearchResultVH> {

    private Context mContext;

    public NavSearchResultAdapter(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public NavSearchResultVH onCreateViewHolder(ViewGroup parent, int viewType) {
        View inflate = LayoutInflater.from(mContext).inflate(R.layout.item_search_history, null);
        return new NavSearchResultVH(inflate);
    }

    @Override
    protected void bindDataToViewHolder(NavSearchResultVH viewHolder, int position, Tip item) {
        viewHolder.setOnItemClickListener(item, mItemClickListener);
        viewHolder.itemName.setText(item.getName());
    }
}
